<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%String contextPath = request.getContextPath(); 
    request.setAttribute("contextPath", contextPath);%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>公告</title>
    <link href="${contextPath }/css/msg.css" rel="stylesheet">
    <link href="${contextPath }/css/bootstrap.min.css" rel="stylesheet">
     <!-- Bootstrap Core CSS -->
    <link href="${contextPath }/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="${contextPath }/css/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="${contextPath }/css/sb-admin-2.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="${contextPath }/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!--common Css-->
    <link href="${contextPath }/css/common.css" rel="stylesheet">
    
    <link href="${contextPath}/iconfont/iconfont.css" rel="stylesheet">
    
   	<script src="${contextPath}/js/jquery.min.js"></script>
   	<script src="${contextPath}/js/bootstrap.min.js"></script>
    <script type="text/javascript">
   		function turn(){
	    	var text = $("#turnGo").val();
	    	
	    	var reg = /^\+?[1-9][0-9]*$/;
	        if (!reg.test(text)) {
	        	alert('请输入正整数');
	            dispear();
	            return;
	        } 
	        if(text-${ result.data.totalPageCount }>0){
	        	alert('请输入合理页数');
	            dispear();
	            return;
	        }
	    	console.log(text);
	    	window.location.href = "${contextPath}/notice/goToMsg?pageNow="+text; 	
	    };
    	
    
        
    
    
    
    </script>
</head>
<body>
    <div class="bg1">
        <header>
            <img src="${contextPath}/imgs/logo.png">
            <ul>
                <li><a href="${contextPath}/notice/goToIndex">首页</a></li>
                <li><a href="${contextPath}/notice/goToMsg?pageNow=1" class="active">公告</a></li>
            </ul>
        </header>
    </div>

    <div class="bg2">
        <div class="content">
            <!--<img src="imgs/contentbg.png">-->
            <ul class="list" style="padding:1%;position:absolute;top:15%">
                <c:forEach items="${result.list}" var="list">
                     <li style="margin:1.2% 0"><a href="${contextPath}/notice/goToMsgContent?id=${list.id}">${list.noticeTheme}<i id="id">${list.id}</i><span>${list.noticeDate}</span></a></li>
                </c:forEach>
                <c:if test="${result.message!='没有公告'}" >
                 <nav aria-label="Page navigation" class="pull-right">
							<ul class="pagination">

								
									<li style="border:none"><a <c:if test="${result.data.pageNow != 1 }">
										href="${contextPath}/notice/goToMsg?pageNow=${result.data.pageNow-1 }" </c:if>
										aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
									</a>
									</li>
								
								<%-- <c:if test="${ result.data.pageNow == 1 }">
									<li style="border:none"><a href="#" aria-label="Previous"> <span
											aria-hidden="true">&laquo;</span>
									</a></li>
								</c:if> --%>

							<%-- 	<c:forEach var="i" begin="1" end="${ answer.data.totalPageCount }">

									<c:if test="${ i >= answer.data.pageNow-2 || i <= answer.data.pageNow+2}">
										<c:if test="${ answer.data.pageNow != i }">
											<li><a href="${contextPath}/setup/answer?pageNow=${i}">${ i }</a></li>
										</c:if>
										<c:if test="${ answer.data.pageNow == i }">
											<li><a href="#">${ i }</a></li>
										</c:if>
									</c:if>
									
									<c:if test="${ i <= answer.data.pageNow-2 || i >= answer.data.pageNow+2}">
									</c:if>

								</c:forEach> --%>
								
								<li style="border:none"><input type="text"  disabled="disabled" id="turn" value="${ result.data.pageNow }/${ result.data.totalPageCount }"  style="text-align:center; width: 79px"></li>


								
									<li style="border:none"><a <c:if
									test="${result.data.pageNow != result.data.totalPageCount }">
										href="${contextPath}/notice/goToMsg?pageNow=${result.data.pageNow+1 }" </c:if>
										aria-label="Next"> <span aria-hidden="true">&raquo;</span>
									</a>
									</li>
								
								<%-- <c:if
									test="${ result.data.pageNow == result.data.totalPageCount }">
									<li><a href="#" aria-label="Next"> <span
											aria-hidden="true">&raquo;</span>
									</a></li>
								</c:if> --%>
								<li style="border:none"><input type="text" id="turnGo"></li>
								
								<li style="border:none"><a href="javascript:turn();">跳转</a></li>
							</ul>
							</nav>
					</c:if> 
	 <c:if test="${result.message=='没有公告'}">
			<script type="text/javascript">
			    location.href='${contextPath}/notice/goToNoMsg';
			</script>			
					   
					   
	</c:if>  
					
            </ul>
        </div>
        
       
    </div>
    
    <footer>

        <p>Copyright 2017 - 2017 laipiao. All Rights Reserved</p>
        <p>来票时时彩郑重提示：彩票有风险，投注需谨慎，不向未满18周岁的青少年出售彩票</p>

    </footer>
</body>
</html>